package com.platform.rpc.intercepter;

import org.apache.commons.lang.StringUtils;

public class AuthHeader {

    private final static String QNAME = "http://www.360buy.com";
    private final static String KEY = "AuthenticationHeader";
    
    private String TOKEN = "Token";
    private String qName;
    private String key;
    private String token;

    public boolean checkTokenValue(String token) {
        if (StringUtils.isEmpty(this.token)) {
            return true;
        }
        if (StringUtils.isEmpty(this.token)) {
            return false;
        }

        return this.token.equals(token);
    }

    public String getqName() {
        if (StringUtils.isEmpty(qName)) {
            qName = QNAME;
        }
        return qName;
    }

    public void setqName(String qName) {
        this.qName = qName;
    }

    public String getKey() {
        if (StringUtils.isEmpty(key)) {
            key = KEY;
        }
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getToken() {
        if (StringUtils.isEmpty(token)) {
            token = TOKEN;
        }
        return token;
    }


    public void setToken(String token) {
        this.token = token;
    }

}
